package org.deltaset.meta.internal;

import java.util.List;
import org.deltaset.meta.MetaAction;
import org.deltaset.meta.MetaEntry;
import org.deltaset.meta.MetaField;
import org.deltaset.meta.annotation.DsViewType;

/**
 *
 * @author dmakariev
 */
class MetaEntryImpl implements MetaEntry {

    private final MetaClassImpl metaClass;

    MetaEntryImpl(final MetaClassImpl metaClass) {
        this.metaClass = metaClass;
    }

    private MetaClassImpl getMetaClass() {
        return metaClass;
    }

    @Override
    public Class getEntityClass() {
        return this.getMetaClass().getEntityClass();
    }

    //////////
    @Override
    public List<MetaAction> getOtherActions() {
        return this.getMetaClass().getActionsFor(MetaActionGroupType.OTHER);
    }

    @Override
    public List<MetaAction> getOtherContextActions() {
        return this.getMetaClass().getActionsFor(MetaActionGroupType.OTHER_CONTEXT);
    }

    @Override
    public List<MetaAction> getFinderActions() {
        return this.getMetaClass().getActionsFor(MetaActionGroupType.FINDER);
    }

    @Override
    public List<MetaAction> getFactoryActions() {
        return this.getMetaClass().getActionsFor(MetaActionGroupType.FACTORY);
    }

    @Override
    public List<MetaAction> getContextActions() {
        return this.getMetaClass().getActionsFor(MetaActionGroupType.CONTEXT);
    }

    @Override
    public List<MetaField> getListFields() {
        return this.getMetaClass().getFieldsFor(DsViewType.LIST);
    }

    @Override
    public List<MetaField> getDetailFields() {
        return this.getMetaClass().getFieldsFor(DsViewType.DETAIL);
    }

    @Override
    public List<MetaField> getFormFields() {
        return this.getMetaClass().getFieldsFor(DsViewType.FORM);
    }

    @Override
    public MetaAction getDefaultFinder() {
        return this.getMetaClass().getDefaultAction();
    }

    @Override
    public MetaAction getFindByIdAction() {
        return this.getMetaClass().getFindByIdAction();
    }
}
